#include "common.fx"

struct OutVS
{
	float4 position : POSITION0;
	float4 normal : NORMAL0;
	float2 texCoord : TEXCOORD0;
};

OutVS basicVS(float3 position : POSITION0, float3 normal : NORMAL0, float2 uv : TEXCOORD0)
{
	OutVS outVert;

	outVert.position = mul(float4(position, 1.0f), MVP);
	outVert.normal   = float4(normal,0.0f);
	outVert.texCoord = uv;

	return outVert;
}

float4 basicPS(OutVS inVS):COLOR
{
	float3 lightDir = float3(10.0f,1.0f,10.0f);
	lightDir = mul(float4(lightDir, 1.0f), MVP);
	float lightIntensity = saturate(dot(inVS.normal, lightDir));

    float4 finalColor = geometryColor * lightIntensity;
    
    return finalColor;
}

technique basicShader
{
	pass P0
    {
        vertexShader = compile vs_3_0 basicVS();
        pixelShader  = compile ps_3_0 basicPS();
    }
}